package ink.liaoxuefeng.exceptionprocess;

/**
 * @author wangzhuangzhuang
 * @DESC:
 * @date 2022-01-25 15:58
 */
public class TestDemo01 {
	public static void main(String[] args) {
		try{
			process01();
// 通过printStackTrace()可以打印出方法的调用栈
//			java.lang.NumberFormatException: null
//			at java.lang.Integer.parseInt(Integer.java:542)
//			at java.lang.Integer.parseInt(Integer.java:615)
//			at ink.liaoxuefeng.exceptionprocess.TestDemo01.process02(TestDemo01.java:22)
//			at ink.liaoxuefeng.exceptionprocess.TestDemo01.process01(TestDemo01.java:18)
//			at ink.liaoxuefeng.exceptionprocess.TestDemo01.main(TestDemo01.java:11)
		}catch(Exception e){
			e.printStackTrace();
		}
	}

	static void process01(){
		process02();
	}

	static void process02(){
		Integer.parseInt(null); // 会抛出NumberFormatException
	}

}